import React,{useState} from "react";
import {Modal,Button,Descriptions} from 'antd'
import {UserOutlined} from '@ant-design/icons'

function CheckStudent(props) {
    const [isModalVisible, setIsModalVisible] = useState(false);
    const {CheckItem,detailed} = props
  
    const handleCancel = () => {
      setIsModalVisible(false);
    };

    const onClick = () => {
        setIsModalVisible(true)
        CheckItem()
    }
    return(
        <>
            <Button style={{marginLeft:-20}} type="link" block onClick={onClick}><UserOutlined />学生信息</Button>
            <Modal title="学生个人信息" visible={isModalVisible} onCancel={handleCancel} footer={null}>
                <p>姓名：{detailed.username}</p>
                <p>性别：{detailed.gender || '暂无信息'}</p>
                <p>生日：{detailed.birthday || '暂无信息'}</p>
                <p>邮箱地址：{detailed.email || '暂无信息'}</p>
                <p>密码：{detailed.password}</p>
                <p>电话号码：{detailed.phone || '暂无信息'}</p>
                <p>班级id：{detailed.class_id}</p>
            </Modal>
            
        </>
    )
}

export default CheckStudent